import { onlyPositiveNumber } from "@/utils/validate"

import CommonInput from "../../common/commonInput"

const ClubId = ({
	allowClear = false,
	placeholderId = "dxn.card_ables_list.club_id_placeholder",
	onChange,
	...props
}: {
	props?: object
	allowClear?: boolean
	placeholderId?: string
	onChange?: (value: string) => void
}) => {
	const onNotAllow = (value: string) => {
		onChange && onChange(value)
	}

	return (
		<CommonInput
			fieldName="clubId"
			allowClear={allowClear}
			placeholderId={placeholderId}
			labelId="dxn.card_ables_list.club_id"
			onChange={e => onlyPositiveNumber(e, onNotAllow)}
			{...props}
		/>
	)
}

export default ClubId
